<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>{$pagetitle}</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/static/admin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/static/admin/style/global.css" media="all">
  <style>
	  .layui-form{min-width:800px;}
	  .layui-form-label{ width:200px;}
	  .layui-form-label span{ font-size: 12px; color:gray;}
	  .layui-form-item .layui-input-inline{width: 500px;}
	  .inline-select,.layui-form [lay-ignore]{ float: left; display: block; width:200px}
	  .inline-i{ float: left; display: block; line-height: 38px; margin-left: 10px;}
	  .inline-i input{width:80px; height: 36px; line-height: 36px; border:0px; border-bottom:1px solid #ccc;border-radius: 2px;}
  </style>
</head>
<body>

<form action="{:url()}" method="post" class="form-horizontal" onsubmit="return save_form2(this)">
  <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
    <div class="layui-form-item">
      <label class="layui-form-label">字段名<span>(由英文与数字组成，且不能以数字开头。比如："title")</span></label>
      <div class="layui-input-inline">
        <input type="text" lay-verify="required" name="field" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">字段标识<span> (比如："标题")</span></label>
      <div class="layui-input-inline">
        <input type="text" lay-verify="required" name="name" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">字段类型</label>
      <div class="layui-input-inline">
			<select name="fieldtype" class="inline-select fieldtype layui-input" lay-ignore>
			{foreach $fieldtype_inc as $k=>$v}			
				<option value="{$k}">{$v}</option>
			{/foreach}
			</select>
			<i class="inline-i fieldlen_i">长度：<input type="text" autocomplete="off" maxlength='5'  name="fieldlen"></i>
      </div>
    </div>
	
    <div class="layui-form-item">
      <label class="layui-form-label">存放表<span>(设置后不能修改)</span></label>
      <div class="layui-input-inline">
            <div class="layui-col-md12">
              <input type="radio" name="issystem" value="1" title="主表"/>
              <input type="radio" name="issystem" value="0" title="副表" checked="true"/>
            </div>
      </div>
    </div>	
    <div class="layui-form-item">
      <label class="layui-form-label">表单类型</label>
      <div class="layui-input-inline">
			<select name="formtype" class="inline-select formtype layui-input" lay-ignore>
			{foreach $formtype_inc as $k=>$v}	
				<option value="{$k}">{$v}</option>
			{/foreach}
			</select>
			
			<i class="inline-i formtype_i_w">宽度：<input type="text" autocomplete="off" name="formwidth" maxlength='3' class="span1" value="" />%</i>  
			<i class="inline-i formtype_i_h">高度：<input type="text" autocomplete="off" maxlength='4' name="formheight" class="span1" value="" />px</i>
			<i class="inline-i formtype_i_imgw">图片压缩最大宽度：<input type="text" autocomplete="off" name="imgwidth" maxlength='4' class="span1" value="1000" />px  (0为不压缩)</i>
			<!--如果设置了高度那么需要裁剪图片，功能目前不开放-->    
			<div style="display: none;"><i class="formtype_i_imgh">高度：<input type="text" maxlength='4' name="imgheight" class="span1" value="" />px</i></div>
      </div>
    </div>		
    <div class="layui-form-item">
		<label class="layui-form-label">初始值<span class="select_tip">(多个值用"回车"格开；下拉/单选/复选”格式用：名称==值；当值等于名称时，名称可省略；默认选项后面加：:default)</span></label>
		<div class="layui-input-inline normalvalue">
			<textarea  class="layui-input" name="defaultval" style="height:150px;"></textarea>
		</div>

		<div class="layui-input-inline morevalue" style="width:800px">
			<table class="layui-table" style="border-right:1px solid #ccc">
				<thead>
					<tr>
						<th class="name">字段名</th>
						<th class="type">字段类型</th>
						<th class="defval">默认值</th>
						<th class="width">宽度</th>
						<th class="doset">操作</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td class="name"><input placeholder="请输入字段名" class="layui-input" name="morevalue_name[]"></td>
						<td class="type">
							<select class="layui-input" lay-ignore name="morevalue_type[]">
								<option value="text">文本框(text)</option>
								<option value="textarea">文本域(textarea)</option>
								<option value="select">下拉框(select)</option>
								<option value="image">图片(image)</option>
								<option value="file">文件(file)</option>
								<option value="video">视频(video)</option>										
							</select>
						</td>
						<td class="defval"><textarea class="layui-input" name="morevalue_defaultvalue[]"></textarea></td>
						<td class="width"><input class="layui-input" value="20" name="morevalue_width[]">%</td>
						<td class="doset">
							<a class="layui-btn layui-btn-primary layui-btn-sm" onclick="morevalue_add(this)"><i class="layui-icon">&#xe654;</i></a>
							<a class="layui-btn layui-btn-primary layui-btn-sm" onclick="morevalue_del(this)"><i class="layui-icon">&#xe640;</i></a>
						</td>
					</tr>	
															
				</tbody>
			</table>
			调用示例
			<textarea style="width:100%; height: 350px; color:#FFF; background:#000">
&lt;table border=&quot;1&quot;&gt;
	&lt;tr&gt;
		&lt;td&gt;标题&lt;/td&gt;
		&lt;td&gt;城市&lt;/td&gt;
		&lt;td&gt;描述&lt;/td&gt;
		&lt;td&gt;小图&lt;/td&gt;
	&lt;/tr&gt;
	&lt;?php
	$morevalue=str2arr($morevalue,&quot;{{RsSplit}}&quot;,&quot;{{FieldSplit}}&quot;);
	foreach($morevalue as $vs){
	?&gt;
	&lt;tr&gt;
		&lt;td&gt;{$vs.0}&lt;/td&gt;
		&lt;td&gt;{$vs.1}&lt;/td&gt;
		&lt;td&gt;{$vs.2}&lt;/td&gt;
		&lt;td&gt;{$vs.3}&lt;/td&gt;
	&lt;/tr&gt;
	&lt;?php
	}
	?&gt;
&lt;/table&gt;
	</textarea>
		</div>		  
	  
    </div>	
    <div class="layui-form-item">
      <label class="layui-form-label">字段提示（placeholder）</label>
      <div class="layui-input-inline">
        <input type="text" name="tips" autocomplete="off" class="layui-input" value="" />
      </div>
    </div>		
    <div class="layui-form-item">
      <label class="layui-form-label">数据校验正则<span>（系统将通过此正则校验表单提交的数据合法性，如果不想校验数据请留空）</span></label>
      <div class="layui-input-inline">
			<input type="text" name="pattern" id="pattern" autocomplete="off" class="layui-input" value="" style="width:300px;float: left; display: block;"/>
			<select onChange="javascript:$('#pattern').val(this.value)"  class="layui-input" lay-ignore style="float: left; display: block;">
			  <option value="">常用正则</option>
				{foreach $pattern_inc as $k=>$v}	
					<option value="{$k}">{$v}</option>
				{/foreach}
			</select>   
      </div>
    </div>	
    <div class="layui-form-item">
      <label class="layui-form-label">数据校验未通过的提示信息</label>
      <div class="layui-input-inline">
        <input type="text" name="errortips" autocomplete="off" class="layui-input" value="" />
      </div>
    </div>		
    <div class="layui-form-item">
      <label class="layui-form-label">保存信息处理函数<span>（用法：直接填写函数名称，如果有附带参数可以在函数名后面加###参数1,参数2.完整例子：usfun###a1,a2）</span></label>
      <div class="layui-input-inline">
        <input type="text" name="savefun" autocomplete="off" class="layui-input" value="" />
		函数触发条件：<br>
		<input type="checkbox" name="savefun_trigger[]" value="add" checked="true" title="增加时"/>
		<input type="checkbox" name="savefun_trigger[]" value="update" checked="true" title="修改时"/>
		<input type="checkbox" name="savefun_trigger[]" value="import_add" checked="true" title="导入[增加]"/>
		<input type="checkbox" name="savefun_trigger[]" value="import_update" checked="true" title="导入[修改]"/>
		<br/>
		函数参数：usfun($value,参数1,参数2...)		
      </div>
    </div>	
    <div class="layui-form-item">
      <label class="layui-form-label">值唯一</label>
      <div class="layui-input-inline">
              <input type="radio" name="isunique" value="1" title="是"/>
              <input type="radio" name="isunique" value="0" checked="true" title="否"/>
      </div>
    </div>					

  </div>
  
	<div class="layui-form-item layui-layout-admin" style="margin-top: 30px;">
		<div class="layui-input-block">
		   <div class="layui-footer" style="left: 0;">
			  <button class="layui-btn" type="submit"  lay-filter="component-form-element">立即提交</button>
			  <button type="reset" class="layui-btn layui-btn-primary close">关闭</button>
		  </div>
		</div>
	</div>  
</form>
{include file="table_field/js"}
</body>
</html>